﻿using ClientAppraise.Services;
using ClientAppraise.ViewModels.Pages.Users;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using Wpf.Ui;
using Wpf.Ui.Controls;

namespace ClientAppraise.Views.Pages.Users
{
    /// <summary>
    /// LoginView.xaml 的交互逻辑
    /// </summary>
    public partial class LoginView : IWindow
    {
        public LoginViewModel ViewModel
        {
            get;
        }
        public LoginView()
        {
            Wpf.Ui.Appearance.SystemThemeWatcher.Watch(this);
            InitializeComponent();

            this.DataContext = this;
            ViewModel = App.GetRequiredService<LoginViewModel>();
            ViewModel.Framework = this;

            TitleBar.ButtonsForeground = SystemColors.ControlTextBrush;
            this.ResizeMode = ResizeMode.NoResize;
            WindowStartupLocation = WindowStartupLocation.CenterScreen;

            this.ContentRendered += LoginView_ContentRendered;
        }

        private void LoginView_ContentRendered(object? sender, EventArgs e)
        {
            // BindingOperations.get

            // TextBox

            App.GetRequiredService<IZxContentDialogService>()?.PushContentPresenter(this.GetHashCode(), this.GetDialogPresenter());
            // await ViewModel.OnRefreshVerificationCodeAsync();//刷新验证码

        }


        public SnackbarPresenter? GetSnackbarPresenter()
        {
            return SnackbarPresenter;
        }

        public ContentPresenter? GetDialogPresenter()
        {
            return RootContentDialog;
        }

        public ContentPresenter? GetDrawerPresenter()
        {
            return null;
        }
        public ContentPresenter? GetTitleRight()
        {
            return null;
        }
    }
}
